<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:a4j="http://richfaces.org/a4j"
    xmlns:rich="http://richfaces.org/rich">
	
<h:head>
	<style type="text/css">
li.err {
	color: red;
	font-weight: bold 
}
	</style>
</h:head>
<body> <h:messages errorClass="err" />
<h1>On-Line Registration</h1>
<h:form id="f">
Please find out the form below to register.
		<h:panelGrid columns="2" border="1">

			<h:outputText id="w" value="Name : " />
			<h:panelGroup>
				<h:inputText id="p" value="#{req.name}" label="Name" validator="#{req.validateName}" required="true" >
					<f:validateLength minimum="2" maximum="30" />
				</h:inputText>
				<h:message for="p"  />
			</h:panelGroup>

			<h:outputText value="Password : " />
			<h:panelGroup>
				<h:inputSecret value="#{req.password}" label="Password"  required="true">
					<f:validateLength minimum="6" maximum="12" /></h:inputSecret>
				<h:message for="w" />
			</h:panelGroup>

			<h:outputText value="Retype password : " />
			<h:panelGroup>
				<h:inputSecret value="#{req.rpassword}" label="Retypepassword" required="true">
					<f:validateLength minimum="6" maximum="12" />
				</h:inputSecret>
				<h:message for="x" />
			</h:panelGroup>

			<h:outputText value="Title : " />
			<h:selectOneMenu value="#{req.title}">
				<f:selectItems value="#{requestService.titleType}"/>
			</h:selectOneMenu>

			<h:outputText value="Email : " />
			<h:panelGroup>
				<h:inputText value="#{req.email}" label="Email" validator="#{req.validateEmail}" required="true">
					<f:validateLength minimum="6" maximum="30" />
				</h:inputText>
				<h:message for="y" />
			</h:panelGroup>

			<h:outputText value="Telefone no : " />
			<h:panelGroup>
				<h:inputText value="#{req.telNo}" label="Telno" required="true">
					<f:validateLength minimum="8" maximum="16" />
				</h:inputText>
				<h:message for="y" />
			</h:panelGroup>
			
		</h:panelGrid>
		<h:commandButton value="OK" action="thankyou.xhtml">
			<f:actionListener type="cm367.RequestValidator"></f:actionListener>
		</h:commandButton>
		<input type="reset" value="Reset"></input>
	</h:form>
</body>
</html>
